package com.xh.bussiness.resource.service;

import java.util.List;

import com.xh.bussiness.resource.bean.request.MaterialCourseIndexRequest;
import com.xh.bussiness.resource.bean.request.MaterialRequest;
import com.xh.bussiness.resource.bean.request.MaterialSaveRequest;
import com.xh.bussiness.resource.model.Material;
import com.xh.core.bean.XhPage;
import com.xh.core.service.IBaseService;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 资料 服务类
 * </p>
 *
 * @author JQM
 * @since 2019-08-27
 */
public interface IMaterialService extends IBaseService<Material> {

    /**
     * 分页查询方法
     * @param page
     * @param bean
     * @return
     */
    public XhPage queryMaterialPage(XhPage page, MaterialRequest bean);

    /**
     * 查询方法
     * @param bean
     * @return
     */
    public List queryMaterial(MaterialRequest bean);

    /**
     * 查询课次绑定的资料
     * @param bean
     * @return
     */
    List queryMaterialByCourseIndexId(MaterialCourseIndexRequest bean);

    boolean batchSave(MaterialSaveRequest materials, HttpServletRequest request);

    boolean saveUserMaterial(MaterialSaveRequest materials,HttpServletRequest request);

    Object queryCountByType(MaterialRequest bean);

    List<Material> queryMaterialByChapterId(String chapterId);

    Material saveMaterial(MaterialRequest materials, HttpServletRequest request);

    List queryChapterById(MaterialCourseIndexRequest bean);

    List<Material> queryUserPrivateMaterial(MaterialRequest bean);

    Material copyMaterial(MaterialRequest material);

    void downMaterial(String materialId, String fileType, Integer type,HttpServletResponse response, HttpServletRequest request) throws Exception;

    Material queryMaterialById(@Param("id") String id);

    Object updateMaterial(HttpServletRequest request, Material material);
}
